import {reactive} from "vue";

export default {
    layout: [],
    columns: reactive([
        {
            title: "主键",
            dataIndex: "id",
            formType: "input",
            addDisplay: false,
            editDisplay: false,
            hide: true,
            commonRules: {
                required: true,
                message: "请输入主键"
            }
        },
        {
            title: "编码",
            dataIndex: "code",
            formType: "input",
            search: true,
            addDisabled:false,
            editDisabled:true,
            commonRules: {
                required: true,
                message: "请输入编码"
            }
        },
        {
            title: "名称",
            dataIndex: "name",
            formType: "input",
            search: true,
            commonRules: {
                required: true,
                message: "请输入名称"
            }
        },
        {
            title: "类型",
            dataIndex: "type",
            formType: "select",
            dict:{
                name:'flrstLegType',
                translation: true
            },
            search: true,
            commonRules: {
                required: true,
                message: "请选择类型"
            }
        },
        {
            title: "供应商",
            dataIndex: "supplier_id",
            formType: "select",
            search: true,
            dict: {
                url: 'logistics/supplier/list',
                props: {
                    label: 'name',
                    value: 'id'
                },
                translation: true
            },
            commonRules: {
                required: true,
                message: "请输入供应商"
            }
        },
        {
            title: "状态",
            dataIndex: "status",
            formType: "radio",
            type:'button',
            search: true,
            commonRules: {
                required: true,
                message: "请选择状态"
            },
            addDefaultValue: 1,
            dict: {
                data: [
                    {value: 1, label: '启用'},
                    {value: 0, label: '禁用'}
                ],
                translation: true,
            }
        },
        {
            title: "备注",
            dataIndex: "remark",
            formType: "textarea",
        },
        {
            title: "创建者",
            dataIndex: "created_by",
            formType: "input",
            addDisplay: false,
            editDisplay: false,
            hide: true
        },
        {
            title: "更新者",
            dataIndex: "updated_by",
            formType: "input",
            addDisplay: false,
            editDisplay: false,
            hide: true
        },
        {
            title: "创建时间",
            dataIndex: "created_at",
            formType: "date",
            addDisplay: false,
            editDisplay: false,
            hide: true,
            showTime: true
        },
        {
            title: "更新时间",
            dataIndex: "updated_at",
            formType: "date",
            addDisplay: false,
            editDisplay: false,
            hide: true,
            showTime: true
        },
        {
            title: "删除时间",
            dataIndex: "deleted_at",
            formType: "date",
            addDisplay: false,
            editDisplay: false,
            hide: true,
            showTime: true
        }
    ])
}